package com.main.organizationandplatformmanagement.interfaces.assembler;

import com.main.common.base.base.BaseAssembler;
import com.main.common.base.base.BaseAssemblerFactory;
import com.main.organizationandplatformmanagement.domain.organization.entity.Organization;
import com.main.organizationandplatformmanagement.domain.organization.entity.OrganizationModelAtomType;
import com.main.organizationandplatformmanagement.interfaces.dto.AddOrganizationDTO;
import com.main.organizationandplatformmanagement.interfaces.dto.AddOrganizationModelAtomTypeDTO;
import jakarta.validation.constraints.NotNull;


public class OrganizationModelAtomTypeAssembler {
    private final BaseAssembler<OrganizationModelAtomType, AddOrganizationModelAtomTypeDTO> baseAssembler;

    public OrganizationModelAtomTypeAssembler(@NotNull BaseAssemblerFactory baseAssemblerFactory) {
        this.baseAssembler = baseAssemblerFactory.getService(AddOrganizationModelAtomTypeDTO.class);
    }

    public OrganizationModelAtomType toEntity(AddOrganizationModelAtomTypeDTO addOrganizationModelAtomTypeDTO) {
        OrganizationModelAtomType organizationModelAtomType = new OrganizationModelAtomType();
        organizationModelAtomType = baseAssembler.toEntity(addOrganizationModelAtomTypeDTO, organizationModelAtomType);
        organizationModelAtomType.setName(addOrganizationModelAtomTypeDTO.getName());
        organizationModelAtomType.setCode(addOrganizationModelAtomTypeDTO.getCode());
        return organizationModelAtomType;
    }

}